package com.justech.eat.global;

import org.springframework.http.HttpOutputMessage;
import org.springframework.http.converter.HttpMessageNotWritableException;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.lang.reflect.Type;

/**
 * @program: eat-service
 * @description: 自定义类型转换器
 * @author: feifei.li
 * @create: 2020-06-01 09:44
 **/
//@Component
public class MyMappingJackson2HttpMessageConverter extends MappingJackson2HttpMessageConverter {
    @Override
    protected void writeInternal(Object object, Type type, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException {
        System.out.println("自定义类型转换器");
        super.writeInternal(object, type, outputMessage);
    }
}
